package Narzedzia;

import java.util.Iterator;
import java.util.LinkedList;

public class ListaElementow<E> extends LinkedList<E> {

	private static final long serialVersionUID = -8358042200743580528L;

	public boolean add(E nowyElement){
		if(contains(nowyElement)){
			return false;
		}
		super.add(nowyElement);
		return true;
	}
	
	@SuppressWarnings("unchecked")
	public String toString(){
		StringBuilder str = new StringBuilder();
		Iterator iterator = iterator();
		while (iterator.hasNext()) {
			E element = (E) iterator.next();
			str.append(element.toString()+ " ; ");
		}
		return str.toString();
	}
}
